package com.syne.facade.module.receiptdetail.controller;

import com.alibaba.fastjson.JSON;
import com.syne.common.utils.CommResultMessage;
import com.syne.facade.module.receiptdetail.service.IReceiptdetailVOService;
import com.syne.facade.module.receiptdetail.vo.*;
import com.syne.framework.web.controller.BaseController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 收货明细 信息操作处理
 *
 * @author ruoyi
 * @date 2018-08-29
 */
@Controller
@RequestMapping("/facade/receiptdetail")
public class ReceiptdetailVOController extends BaseController {

    @Autowired
    private IReceiptdetailVOService receiptdetailService;

    /**
     * @return
     */
    @GetMapping("/receiptvo")
    @ResponseBody
    public List<RecetipVO> selectReceiptVOList() {
        List<RecetipVO> list = receiptdetailService.selectReceiptVOList();
        return list;
    }

    /**
     * @return
     */
    @GetMapping("/receiptvo2")
    @ResponseBody
    public CommResultMessage selectReceiptVOList2() {
        CommResultMessage commResultMessage = new CommResultMessage();
        commResultMessage.setStatus("S");
        commResultMessage.setMessage("没有报错");

        List<RecetipVO> list = receiptdetailService.selectReceiptVOList();
        ReturnVO returnVO = new ReturnVO();
        returnVO.setOrderkey("11111111");
        returnVO.setStoerekey("100005");
        returnVO.setList(list);
        System.out.println(JSON.toJSONString(returnVO));
        commResultMessage.setJsondata(JSON.toJSONString(returnVO));
        String jsonStr = JSON.toJSONString(commResultMessage);
        return commResultMessage;
    }

}
